package com.hotelsystem.dao;

import com.hotelsystem.pojo.Room;
import com.hotelsystem.pojo.vo.RoomQueryVo;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Update;

import java.util.List;

public interface RoomMapper {

    /**
     * 修改房间状态
     * @param roomId 房间号
     * @param status 房间状态
     * @return
     * @throws Exception
     */
    @Update("update t_room set status_id = #{status} where room_id = #{roomId}")
    Integer updateStatusByRoomId(@Param("roomId") String roomId, @Param("status") Integer status) throws Exception;

    /**
     * 查询全部
     * @return
     */
    List<Room> selectAll();

    /**
     * 根据条件分页查询
     * @param roomQueryVo
     * @return
     */
    List<Room> getPageforRoomLists(@Param("roomQueryVo") RoomQueryVo roomQueryVo);

    /**
     * 根据房间号查询房屋信息
     * @param roomId
     * @return
     */
    Room getRoomInfoWithId(String roomId);

    /**
     * 根据房间号删除房间信息
     * @param roomId
     * @return
     */
    Integer deleteRoomInfoWithId(String roomId);

    /**
     * 添加房屋信息
     * @param room
     */
    void addRoomInfoByRoom(Room room);

    /**
     * 修改房屋信息
     * @param room
     */
    void updateRoomInfoByRoomId(Room room);
}